import request from '@/utils/request'

// 查询尽调清单列表
export function listDealDd(query) {
  return request({
    url: '/dd/dealDd/list',
    method: 'get',
    params: query
  })
}

// 查询尽调清单详细
export function getDealDd(id) {
  return request({
    url: '/dd/dealDd/' + id,
    method: 'get'
  })
}

// 保存尽调清单
export function saveDealDd(data) {
  return request({
    url: '/dd/dealDd/save',
    method: 'post',
    data: data
  })
}

// 删除尽调清单
export function delDealDd(id) {
  return request({
    url: '/dd/dealDd/' + id,
    method: 'delete'
  })
}

// 导出尽调清单
export function exportDealDd(query) {
  return request({
    url: '/dd/dealDd/export',
    method: 'get',
    params: query
  })
}

// 获取table表头数据
export function getTableTitle(dealId) {
 return request({
   url: '/dd/dealDd/getTableTitle/' + dealId,
   method: 'get'
 })
}

// 保存全面尽调
export function saveAllRound(data) {
  return request({
    url: '/round/dealAllRound/save',
    method: 'post',
    data: data
  })
}

// 删除全面尽调
export function deleteById(id) {
  return request({
    url: '/round/dealAllRound/' + id,
    method: 'delete'
  })
}

// 检查是否已经存在过尽调 没有则初始化
export function checkExistDd(dealId) {
  return request({
    url: '/round/dealAllRound/checkExistDd/' + dealId,
    method: 'get'
  })
}

// 获取全部尽调
export function getAllRoundList(dealId) {
 return request({
   url: '/round/dealAllRound/list',
   method: 'get',
   params: { 'dealId': dealId }
 })
}
// 根据项目id查询列表
export function dealAllRoundList(param) {
  return request({
    url: '/round/dealAllRound/dealAllRoundList',
    method: 'get',
    params: param
  })
}

// 根据尽调清单子类 和 项目id删除
export function deleteByCategoriesChildType(categoriesChildType, dealId) {
  return request({
    url: '/round/dealAllRound/deleteByCategoriesChildType/' + categoriesChildType + '/' + dealId,
    method: 'delete'
  })
}

// 保存尽调内容
export function saveContent(data) {
  return request({
    url: '/round/dealAllRound/saveDate',
    method: 'post',
    data: data
  })
}

// 查询子类尽调内容详情
export function getByDealIdAndCategoriesChildType(dealId, categoriesChildType) {
  return request({
    url: '/round/dealAllRound/getByDealIdAndCategoriesChildType/' + dealId + '/' + categoriesChildType,
    method: 'get'
  })
}
